<template>
    <div>
        <h1>Child</h1>
        <h3>{{ num }}</h3>
    </div>
</template>

<script>
import { mapState } from "vuex";

export default {
    name: "Child",
    computed: {
        // num() {
        //     return this.$store.state.num;
        // },
        ...mapState(["num"]),
    },
    mounted() {
        const res = mapState({ num: "num" });
        console.log(res.num.call(this));
    },
};
</script>

<style></style>
